package cn.antblog.gof.chainofresponsibility;

/**
 * @author yangjy
 * @version 1.0
 * @description: 类描述：责任链模式测试类
 * @date 2022/8/12 10:43
 */
public class Main {
    public static void main(String[] args) {

        Request request = new Request.Builder().setName("张三").setDays(5)
                .setReason("事假").build();
        ChainOfResponsibilityClient client = new ChainOfResponsibilityClient();
        Result result = client.execute(request);
        System.out.println("结果：" + result.toString());

//。刚开始就提到这个责任链模式是可以“动态扩展的”，我们验证一下，首先自定义一个“责任人”（其实也可以叫拦截器）：
//        Request request = new Request.Builder().setName("张三").setDays(5)
//                .setReason("事假").build();
//        ChainOfResponsibilityClient client = new ChainOfResponsibilityClient();
//        client.addRatifys(new CustomInterceptor());
//        Result result = client.execute(request);
//
//        System.out.println("结果：" + result.toString());

    }


}
